package com.gooluke.auth.enums;

import com.gooluke.auth.exception.AuthenticationException;
import com.gooluke.auth.exception.AuthorizationException;
import com.gooluke.auth.exception.BusinessException;
import com.gooluke.auth.exception.RequestLimitException;
import com.gooluke.common.domain.ErrorStatus;
import lombok.Getter;

/**
 * @author gooluke
 * description
 * datetime 2025-03-28 15:45
 */
@Getter
public enum AuthException implements ErrorStatus {

    BUSINESS(500, "业务异常", BusinessException.class),
    AUTHENTICATION(500, "认证失败", AuthenticationException.class),
    AUTHORIZATION(500, "授权失败", AuthorizationException.class),
    REQUEST_LIMIT(500, "请求次数超出限制", RequestLimitException.class),
    ;

    private final int code;
    private final String message;
    private final Class<? extends RuntimeException> exception;

    AuthException(int code, String message, Class<? extends RuntimeException> exception) {
        this.code = code;
        this.message = message;
        this.exception = exception;
    }

}
